var api = require('../../utils/api.js')
var app = getApp()


Page({

    /**
     * 页面的初始数据
     */
    data: {
        list:[]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.getallcate();
    },

    getallcate(){
        var that=this;
        api.post({
            url: 'ziliao/getallcat',
            data: {},
            success: data => {
                console.log(data);
                that.setData({
                    list:data.data
                })
            }
        });
    },
    getlistbyid(ret){
        console.log(ret);
        var id=ret.currentTarget.dataset.id;

        wx.navigateTo({
          url: '/pages/ziliao/lists?id='+id
        })
    }
})